how to derive the derivative of cot(x)